//
//  SignView.swift
//  SignView
//
//  Created by caijinglong on 2017/11/28.
//  Copyright © 2017年 caijinglong. All rights reserved.
//

import UIKit

class SignView: UIView {

    /*
    // Only override draw() if you perform custom drawing.
    // An empty implementation adversely affects performance during animation.
    override func draw(_ rect: CGRect) {
        // Drawing code
    }
    */

    required init?(coder aDecoder: NSCoder) {
        super.init(coder: aDecoder)
        initView()
    }
    
    override init(frame: CGRect) {
        super.init(frame: frame)
        initView()
    }
 
    func initView(){
        let pan = UIPanGestureRecognizer(target: self, action: #selector(SignView.pan))
        addGestureRecognizer(pan)
    }
    
    var list = [PointF]()
    
    @objc func pan(ges:UIPanGestureRecognizer){
        let point = ges.location(in: self)
        NSLog("x = \(point.x) y = \(point.y)")
        var connectLine = false
        if ges.state == .began{
            connectLine = true
        }
        let p = PointF(point: point, connectLine: connectLine)
        list.append(p)
    }
}

struct PointF {
    var point:CGPoint
    var connectLine :Bool
}
